import { Video } from '@/models/index'
// const videos:Video[] = [{

// }]
export const getVideosRequest = (): Promise<Video[]> => {
    const p = new Promise<Video[]>((resolve, reject) => {
        // setTimeout(() => {
        //     resolve(videos)
        // }, 1000)
        fetch('http://localhost:3300/getVideos')
            .then(data => data.json())
            .then(data => {
                console.log(data)
                resolve(data)
            })
    })
    return p;
}

export const getHotWordRequest = ():Promise<any[]> => {
    const p = new Promise<any[]>((resolve, reject) => {
        fetch('http://localhost:3300/search/hotword')
            .then(data => data.json())
            .then(data => {
                resolve(data)
            })
    })
    return p
}